import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import path from 'path';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [uni()],
  server: {
  	proxy: {
  		'/api/': {
  			target:
  				'http://111.230.25.88:9090',
  			changeOrigin: true,
  			rewrite: (p) => p.replace(/^\/api/, '')
  		},
  		
  	}
  },
  resolve: {
  	alias: {
  		'@': path.resolve('./src'), // @代替src
  	}
  },
   css: {
        preprocessorOptions: {
          less: {
            javascriptEnabled: true,
            additionalData: `@import "${path.resolve(
              __dirname,
              "src/common/style/variable.less"
            )}";`,
          },
        },
      },
});
